from flask import Flask, jsonify
import prediction
import config

app = Flask(__name__)

@app.route('/predict_rating', methods=['GET'])
def predict_rating():
    userId = 1
    movieId = 3
    input_size =  config.model_input_size
    hidden_size =  config.model_hidden_size
    output_size =  config.model_output_size

    rating = prediction.recommend(userId, movieId, input_size, hidden_size, output_size)
    return jsonify({'userId': userId, 'movieId': movieId, 'rating': rating})

if __name__ == '__main__':
    app.run(debug=True)
